/*
 * "Galcon" spēles datu struktūras
 *
 */
#ifndef DATA_H
#define DATA_H

struct Planet_s {
    int x;	// planet's position
    int y;	// planet's position
    int pid;	// planet's id
    int uid;	// owner user's id
    int capacity;	// maximums solider capacity
    int soliders;	// current solider count
};

typedef struct Planet_s Planet_t;

struct Player_s {
    int uid;	// user's id
    char *name; // username
};

typedef struct Player_s Player_t;

struct Fleet_s {
    int from;	// planet id from which the fleet is sent
    int to;	// planet id to -//-
    int amount; // solider count
    int eta;	// time left before arrival
    int uid;	// user, that sent fleet
    struct Fleet_s *next;
};

typedef struct Fleet_s Fleet_t;

struct ServerConfig_s {
    int max_players;	// maximum players count
    int planet_count;   // planet count on map
    int speed;		// soliders speed (units per second)
    int start_timeout;	// timeout before the game is started
    int min_capacity;	// minimum planet capacity
    int max_capacity;	// maximum planet capacity
    Player_t *players;	// list of all players
    Planet_t *planets;	// list of all planets
    int PID;	// last assigned planet id
    int UID;	// last assigned user id
    Fleet_t *fleets;	// linked list of all players' fleets
};

typedef struct ServerConfig_s ServerConfig_t;

#endif
